import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {MyComponent} from './components/my/my.component';
import {AboutComponent} from './components/about/about.component';
import {NavComponent} from './components/nav/nav.component';
import {FormsModule} from '@angular/forms';
import {AppComponent} from './components/app/app.component';
import {HttpClientModule} from '@angular/common/http';
import {AppRoutingModule} from './module/app-routing.module';
import {ApiService} from './service/ApiService';
import {HerosComponent} from './components/heros/heros.component';
import {HeroDetailComponent} from './components/hero-detail/hero-detail.component';
import {HeroService} from './service/heroService/hero-service.service';
import {MessagesComponent} from './components/messages/messages.component';
import {MessagesService} from './service/messages/messages.service';
import {AppRoutingModules} from './module/app-routing/app-routing.module';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import {HttpClientInMemoryWebApiModule} from 'angular-in-memory-web-api';
import {InMemoryDataService} from './service/in-memory-data.service';
import { HeroSearchComponent } from './components/hero-search/hero-search.component';

@NgModule({
  declarations: [
    AppComponent,
    /*声明要加载的组件*/
    MyComponent,
    AboutComponent,
    NavComponent,
    HerosComponent,
    HeroDetailComponent,
    MessagesComponent,
    DashboardComponent,
    HeroSearchComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
    AppRoutingModules,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService, { dataEncapsulation: false })
  ],
  providers: [
    ApiService,
    HeroService,
    MessagesService
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
